<template>
	<view class="content">
		<view class="complete-box">
			<view class="complete-img"><image src="../../static/pay.png" mode=""></image></view>
			<view class="complete-tleie">
				<view class="complete-h4">支付成功！</view>
				<view class="complete-p">请您耐心等待，我们将尽快为您出单</view>
			</view>
			<view class="ch-box">
				<text>取餐码：{{data}}</text>
			</view>
			<view class="complete-an">
				<button type="default" class="jx-btn" @click="ckcrder()">查看订单</button>
				<button type="default" class="wanc-btn" @click="fhidx()">返回主页</button>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
			data() {
				return {
					data:''
				}
			},
			onLoad(id) {
				var than = this
				uni.request({
      	  url: getApp().globalData.http + "/order/code",
      	  data: {
      	    order_id: id.id
      	  },
      	  method: "post",
      	  header: {
      	    "content-type": "application/x-www-form-urlencoded",
      	    token: uni.getStorageSync("token")
      	  },
      	  success: res => {
						if (res.data.code == 1) {
							than.data = res.data.data
						}
      	  }
      	});
			},
			methods: {
				//查看订单
				ckcrder(){
					uni.reLaunch({
						url:'/pages/my/order'
					})	
				},
				//返回首页
				fhidx(){
					uni.reLaunch({
						url:'/pages/index/index'
					})	
				}
			}
		}
</script>
